<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">


    <title>北京循一堂健康管理有限公司</title>

    <link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="./plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" type="text/css">
    <link href="./plugins/bootstrap-datepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="./css/page.css" />
</head>


<body class="fixed-left">
    <script src="./js/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".tab").slide({ //切换新闻
                titCell: ".hd li",
                mainCell: ".bd",
                targetCell: ".more li",
                effect: "fade",
                autoPlay: false,
                trigger: "click",
                easing: "linear",
                delayTime: 0
            });

            $(".yylb .tab").slide({ //切换新闻
                titCell: ".hd li",
                mainCell: ".bd",
                targetCell: ".more li",
                effect: "fade",
                autoPlay: false,
                trigger: "click",
                easing: "linear",
                delayTime: 0
            });

        });

        function ScrollImgLeft() {
            var speed = 50;
            var scroll_begin = document.getElementById("scroll_begin");
            var scroll_end = document.getElementById("scroll_end");
            var scroll_div = document.getElementById("scroll_div");
            scroll_end.innerHTML = scroll_begin.innerHTML;

            function Marquee() {
                if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
                    scroll_div.scrollLeft -= scroll_begin.offsetWidth;
                else
                    scroll_div.scrollLeft++;
            }
            var MyMar = setInterval(Marquee, speed);
            scroll_div.onmouseover = function () {
                clearInterval(MyMar);
            }
            scroll_div.onmouseout = function () {
                MyMar = setInterval(Marquee, speed);
            }
        }
    </script>
    <div class="header">
        <div class="container right-b clearfix">
            <div class="logo fl"><img src="./images/logo.jpg" /></div>

            <div class="center fl">
                <div style="width:96%;height:21px;margin:0 auto;white-space: nowrap;overflow:hidden;" id="scroll_div"
                    class="scroll_div">
                    <div id="scroll_begin">
                        <a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
                        <a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
                        <a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
                        <a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
                    </div>
                    <div id="scroll_end"></div>
                </div>
                <script type="text/javascript">
                    ScrollImgLeft();
                </script>
            </div>

            <div class="data fr clearfix">
                <div class="tx">
                    <img src="./images/logo.jpg" alt="" height="50" />
                </div>
                <div class="name">
                    <button onclick="">退出登录</button>
                    <p>欢迎胡凤亮医生<button onclick="" id="name"></button></p>
                </div>


            </div>
        </div>
    </div>
    <div class="main clearfix">
        <div class="tab fl">

            <div class="bd container">
                <ul class="ypk">
                    <div class="ss">
                        <input type="text" name="" id="moreSearch" value="" />
                        <button type="button">搜索</button>
                    </div>
                    <table border="0" cellspacing="0" cellpadding="0" width="1168">
                        <tr>
                            <th width="107px" class="tl">药品编号</th>
                            <th width="104px">药品简称</th>
                            <th width="131px" class="tl">药品名称</th>
                            <th width="98px">规格</th>
                            <th width="90px">价格</th>
                            <th width="82px">剂型</th>
                            <th width="106px">贵重标志</th>
                            <th width="100px">麻醉标志</th>
                            <th width="222px" class="tl">限制提醒</th>
                            <th width="120px">库存</th>
                        </tr>

                        <tr>
                            <td class="tl">20180912001</td>
                            <td>dg</td>
                            <td class="tl">当归</td>
                            <td>全尺寸</td>
                            <td>88</td>
                            <td>50</td>
                            <td>是</td>
                            <td>是</td>
                            <td class="tl">不适合饭前</td>
                            <td>826</td>
                        </tr>
                        <tr class="b-d7">
                            <td class="tl">20180913002</td>
                            <td>clz</td>
                            <td class="tl">车厘子</td>
                            <td>紧凑型</td>
                            <td>1288</td>
                            <td>120</td>
                            <td>是</td>
                            <td>否</td>
                            <td class="tl">无</td>
                            <td>1206</td>
                        </tr>


                    </table>

                    <div id="page" class="clearfix">
                        <ul>
                            <a href="#">
                                <li>上一页</li>
                            </a>
                            <a href="#">
                                <li class="on">1</li>
                            </a>
                            <a href="#">
                                <li>下一页</li>
                            </a>
                        </ul>
                    </div>

                </ul>

            </div>
        </div>

    </div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div class="footer" style="left:0px">
        <p>版权所有 © 2018-2020 北京循一堂健康管理有限公司&nbsp;&nbsp;&nbsp;技术支持电话：010-62084321</p>
    </div>
    <script>
        var resizefunc = [];
    </script>

    <!-- jQuery  -->
    <script src="./js/bootstrap.min.js"></script>
    <script src="./plugins/select/js/bootstrap-select.min.js"></script>

    <script src="./plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="./plugins/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>

    <script src="./plugins/bootstrap-datepicker/js/moment.js"></script>
    <script src="./plugins/bootstrap-datepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="./js/jquery.SuperSlide.2.1.1.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        window.baseUrl = localStorage.getItem("baseUrl");
        window.moreSearch = "";
        console.log(localStorage.getItem("Authorization"));
        jQuery(document).ready(function ($) {

            $('#contentDiv').find('li').each(function () {
                $(this).click(function () {
                    var index=$(this).index();
                        if(index==0){
                            window.location.href="patientlibrary.html";
                        }else if(index==1){
                            window.location.href="appointlist.html";
                        }else if(index==2){
                            window.location.href="workplan.html";
                        // }else if(index==3){
                        //     window.location.href="workplan.html";
                        }else if(index==3){
                            window.location.href="usercenter.html";
                        }else if(index==4){
                            window.location.href="medicalservice.html";
                        }else if(index==5){
                            window.location.href="./im/main.html";
                        }else if(index==7){

                        }else if(index==8){

                        }else if(index==9){

                        }
                })
            });

            $('#datetimepicker').datetimepicker({
                format: "YYYY-MM-DD HH:MM:SS"
            });

            var $table = $('#userTable');
            var $remove = $('#btn_delete'),
                $add = $('#btn_add'),
                $edit = $('#btn_edit'),
                toolbar = "#userToolbar";

            $table.bootstrapTable({
                contentType: "application/x-www-form-urlencoded",
                method: "post",
                toolbar: toolbar,
                showRefresh: true,
                showToggle: true,
                pagination: true,
                showColumns: true,
                idField: "id",
                sortName: 'createtime',
                sortOrder: 'desc',
                pageSize: 10,
                pageList: [10, 25, 50, 100],
                queryParamsType: "",
                queryParams: function (params) {
                    //将查询条件添加到查询参数中，分页或者刷新时将携带这些参数
                    params["moreSearch"] = window.moreSearch;
                    params["pageNumber"] = params.pageNumber;
                    params["pageSize"] = params.pageSize;
                    params["sortOrder"] = params.sortOrder;
                    params["sortName"] = params.sortName;
                    return params;
                },
                sidePagination: "server",
                url: window.baseUrl + "/article",
                columns: [
                    /* {field:"state",checkbox:true}, */
                    {
                        field: "id",
                        title: "编号"
                    },
                    {
                        field: "name",
                        title: "姓名",
                        sortable: true
                    },
                    {
                        field: "sex",
                        title: "性别",
                        sortable: true
                    },
                    {
                        field: "age",
                        title: "年龄",
                        sortable: true
                    },
                    {
                        field: "history",
                        title: "就医历史",
                        sortable: true
                    },
                    {
                        field: "diagnose",
                        title: "诊断",
                        sortable: true
                    },
                    {
                        field: "bumen",
                        title: "部门",
                        sortable: true
                    },
                    {
                        field: "opt",
                        title: "操作",
                        formatter: function (value, row) {
                            return '<button onclick="" class="b_ck fl"></button>' +
                                '<button onclick="" class="b_fxx fl"></button>' +
                                '<button onclick="" class="b_lh fl"></button>';
                        }
                    }

                ]
            });
            $table.on('check.bs.table uncheck.bs.table ' +
                'check-all.bs.table uncheck-all.bs.table',
                function () {
                    initBtnStatus();
                });

            //数据已添加到table中，onPostBody
            $table.on('post-body.bs.table', function (data) {
                initBtnStatus();
                //为按钮绑定事件
                $table.find(".detailBtn").click(function () {
                    window.open("http://hrfile.zcwjvr.com/file/down/" + $(this).data().id);
                });
            });

            //数据加载完成事件，onLoadSuccess
            $table.on('load-success.bs.table', function () {
                initBtnStatus();
            });

            function initBtnStatus() {
                var len = $table.bootstrapTable('getSelections').length;
                $remove.prop('disabled', !len);
                $edit.prop('disabled', len != 1);
            }

            function getFileIdSelections() {
                return $.map($table.bootstrapTable('getSelections'), function (row) {
                    return row.fileid
                });
            }

            function getIdSelections() {
                return $.map($table.bootstrapTable('getSelections'), function (row) {
                    return row.id
                });
            }

            $add.click(function () {
                window.location.href = "/jianliAdd";
            });

            $edit.click(function () {
                $.map($table.bootstrapTable('getSelections'), function (row) {
                    $("#userName").val(row.uname);
                    $("#userSex").val(row.usex);
                    $("#userAge").val(row.xueli);
                    $("#userJob").val(row.roll);
                    $("#userBumen").selectpicker('val', row.bumen);
                    $("#userChannel").val(row.fro);
                    $("#userTime").val(row.disptime);
                    $("#userAttention").val(row.focus_member);
                    $('#userStatus').selectpicker('val', row.zhuangtai);
                    $("#userMemo").val(row.memo);
                    $("#datetimepicker").val(row.meettime);
                });

            });
            $("#saveBtn").click(function () {
                var ids = getIdSelections();
                var userStatus = $('#userStatus').val();
                var userMemo = $('#userMemo').val();
                var userInfo = $('#userInfo').val();
                var userBumen = $('#userBumen').val();
                var meettime = $("#datetimepicker").val();
                $.ajax({
                    url: "/updateJianli?id=" + ids[0] + "&status=" + userStatus + "&memo=" +
                        userMemo + "&bumen=" + userBumen + "&meettime=" + meettime,
                    type: "GET",
                    success: function (result) {
                        if (result.success == true) {
                            sweetAlert('更新成功');
                            refresh();
                        } else {
                            sweetAlert('更新失败,请重试!');
                            refresh();
                        }
                    }
                });
            });
            $("#editPwdBtn").click(function () {
                var pwd = $("#newpwd").val();
                var pwd2 = $("#newpwd2").val();

                if (pwd == "") {
                    alert("密码不能为空");
                    return false;
                }
                if (pwd2 == "") {
                    alert("密码不能为空");
                    return false;
                }
                if (pwd != pwd2) {
                    alert("两次密码不一致");
                    return false;
                }
                $.ajax({
                    url: "/modifypwd?pid=${member.member_id}&pname=${member.username}&newpwd=" +
                        pwd,
                    type: "GET",
                    success: function (result) {
                        sweetAlert('更新成功');
                    }
                });
            });
            //刷新并跳转到第一页页面
            function refresh() {
                //刷新并跳转到第一页
                $table.bootstrapTable('selectPage', 1);
                //$table.bootstrapTable('refresh');
            };
            $("#btn_query").click(function () {
                window.searchName = $("#searchName").val();
                window.searchFocus = $("#searchFocus").val();
                window.searchSex = $("#searchSex").val();
                window.searchFrom = $("#searchFrom").val();
                window.searchTo = $("#searchTo").val();
                window.searchJob = $("#searchJob").val();
                window.searchChannel = $("#searchChannel").val();
                window.searchStatus = $("#searchStatus").val();
                window.searchBumen = $("#searchBumen").val();
                refresh();
            });
            $("#btn_more_query").click(function () {
                window.moreSearch = $("#moreSearch").val();
                refresh();
            });
        });
    </script>


</body>

</html>